const fs = require("fs");
const read = function(fileName){
    return new Promise((resolve, reject) => {
        fs.readFile(fileName, (err,data)=>{
            if(err){
                reject(err)
            }else{
                resolve(data)
            }
        });
    })
}
async function readByAsync(){
    let a1 = await read('./1.text');
    console.log(a1.toString());
    let a2 = await read('./2.text');
    console.log(a1.toString());
    console.log(a2.toString());
}
readByAsync()